package thread;

/**
 * 线程的优先级
 */
public class PriorityDemo {
    public static void main(String[] args) {
        Thread max=new Thread(()->{
            for (int i=0;i<1000;i++){
                System.out.println("max");
            }
        });
        Thread min=new Thread(()->{
            for (int i=0;i<1000;i++){
                System.out.println("min");
            }
        });
        Thread norm=new Thread(()->{
            for (int i=0;i<1000;i++){
                System.out.println("nor");
            }
        });
        //

        Thread mm=new Thread(){
            public void run(){
                for (int i=0;i<1000;i++){
                    System.out.println("mm");
                }
            }
        };

        //
        max.setPriority(Thread.MAX_PRIORITY);
        min.setPriority(Thread.MIN_PRIORITY);

        max.start();
        min.start();
        norm.start();



    }
}
